package com.csun.cmny.provider.model.enums.follow;

import java.util.Arrays;
import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-02-15 20:39
 * @Description:
 */
public enum FollowTemperatureStatusEnum {

    /**
     * 体温过低
     */
    TEMPERATURE_LOW_MORE("体温过低", "注意适当保暖，使室温保持24-26度", (float) 0, (float) 35),

    /**
     * 体温偏低
     */
    TEMPERATURE_LOW("体温偏低", "注意保暖，多喝温水", (float) 35, (float) 36),

    /**
     * 正常
     */
    TEMPERATURE_NORMAL("正常", "注意饮水，保持正常的新陈代谢", (float) 36, (float) 37),

    /**
     * 低热
     */
    TEMPERATURE_LOW_HOT("低热", "请及时就医检查", (float) 37, (float) 38),

    /**
     * 中度发热
     */
    TEMPERATURE_MID_HOT("中度发热", "请及时就医检查并进行必要的治疗", (float) 38, (float) 39),

    /**
     * 高热
     */
    TEMPERATURE_HIGH_HOT("高热", "请及时就医检查并进行必要的治疗，需要尽快降低体温", (float) 39, (float) 41),

    /**
     * 超高温
     */
    TEMPERATURE_HIGH_HOT_MORE("超高温", "请进行紧急降温处理并送医院治疗", (float) 41, (float) 100),;

    String status;

    String suggest;

    Float boxygenLow;

    Float boxygenHigh;

    FollowTemperatureStatusEnum(String status, String suggest, Float boxygenLow, Float boxygenHigh) {
        this.status = status;
        this.suggest = suggest;
        this.boxygenLow = boxygenLow;
        this.boxygenHigh = boxygenHigh;
    }

    /**
     * Gets status.
     *
     * @return  the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * Gets suggest.
     *
     * @return  the suggest
     */
    public String getSuggest() {
        return suggest;
    }

    /**
     * 获取状态
     */
    public static String getStatus(Float boxygen) {

        for (FollowTemperatureStatusEnum ele : FollowTemperatureStatusEnum.values()) {
            if (boxygen.compareTo(ele.boxygenLow) >=0 && boxygen.compareTo(ele.boxygenHigh) < 0) {
                return ele.getStatus();
            }
        }
        return null;
    }

    /**
     * 获取建议
     */
    public static String getSuggest(Float boxygen) {

        for (FollowTemperatureStatusEnum ele : FollowTemperatureStatusEnum.values()) {
            if (boxygen.compareTo(ele.boxygenLow) >=0 && boxygen.compareTo(ele.boxygenHigh) < 0) {
                return ele.getSuggest();
            }
        }
        return null;
    }

    /**
     * 获取List集合
     *
     * @return List list
     */
    public static List<FollowTemperatureStatusEnum> getList() {
        return Arrays.asList(FollowTemperatureStatusEnum.values());
    }
}
